<?php
$TaskName=$_POST['TaskName']?? '';
$TaskContent=$_POST['TaskContent']?? '';

$dsn = "sqlsrv:Server=localhost;Database=Task";
$db = new PDO($dsn, "sa", "123456");
$sql = "insert into Task (TaskName,TaskContent) 
                values ('{$TaskName}','{$TaskContent}');";
$result = $db->exec($sql);

if ($result) {
    echo "增加成功". "<a href='task_list.php'>返回列表页";;
} else {
    echo "增加失败，";
}

